package com.zy.configs;

import com.fasterxml.jackson.annotation.JsonInclude;


import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: shopping153_cloud
 * @description: 对jackson生成的json字符串的配置
 * @author: zy
 * @create: 2025-08-20 14:37
 */
@Configuration
public class JsonConfig {
    @Bean
    public Jackson2ObjectMapperBuilderCustomizer customizer() {
        return builder -> builder.serializationInclusion(JsonInclude.Include.NON_EMPTY); // 设置 jackson序列时，遇到空值不序列化
    }

}
